home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / combatsc.c < prev    next >
C/C++ Source or Header  |  2000-04-04  |  31KB  |  920 lines

  1. /***************************************************************************
  2.  
  3. "Combat School" (also known as "Boot Camp") - (Konami GX611)
  4.  
  5. TODO:
  6. - in combasc (and more generally the 007121) the number of sprites can be
  7.   increased from 0x40 to 0x80. There is a hack in konamiic.c to handle that,
  8.   but it is wrong. If you don't pass the Iron Man stage, a few sprites are
  9.   left dangling on the screen.
  10. - it seems that to get correct target colors in firing range III we have to
  11.   use the WRONG lookup table (the one for tiles instead of the one for
  12.   sprites).
  13. - in combascb, wrong sprite/char priority (see cpu head at beginning of arm
  14.   wrestling, and heads in intermission after firing range III)
  15. - hook up sound in bootleg (the current sound is a hack, making use of the
  16.   Konami ROMset)
  17. - understand how the trackball really works
  18. - YM2203 pitch is wrong. Fixing it screws up the tempo.
  19.  
  20. Credits:
  21.  
  22.     Hardware Info:
  23.         Jose Tejada Gomez
  24.         Manuel Abadia
  25.         Cesareo Gutierrez
  26.  
  27.     MAME Driver:
  28.         Phil Stroffolino
  29.         Manuel Abadia
  30.  
  31. Memory Maps (preliminary):
  32.  
  33. ***************************
  34. * Combat School (bootleg) *
  35. ***************************
  36.  
  37. MAIN CPU:
  38. ---------
  39. 00c0-00c3    Objects control
  40. 0500        bankswitch control
  41. 0600-06ff    palette
  42. 0800-1fff    RAM
  43. 2000-2fff    Video RAM (banked)
  44. 3000-3fff    Object RAM (banked)
  45. 4000-7fff    Banked Area + IO + Video Registers
  46. 8000-ffff    ROM
  47.  
  48. SOUND CPU:
  49. ----------
  50. 0000-8000    ROM
  51. 8000-87ef    RAM
  52. 87f0-87ff    ???
  53. 9000-9001    YM2203
  54. 9008        ???
  55. 9800        OKIM5205?
  56. a000        soundlatch?
  57. a800        OKIM5205?
  58. fffc-ffff    ???
  59.  
  60.  
  61.         Notes about the sound systsem of the bootleg:
  62.         ---------------------------------------------
  63.         The positions 0x87f0-0x87ff are very important, it
  64.         does work similar to a semaphore (same as a lot of
  65.         vblank bits). For example in the init code, it writes
  66.         zero to 0x87fa, then it waits to it 'll be different
  67.         to zero, but it isn't written by this cpu. (shareram?)
  68.         I have tried put here a K007232 chip, but it didn't
  69.         work.
  70.  
  71.         Sound chips: OKI M5205 & YM2203
  72.  
  73.         We are using the other sound hardware for now.
  74.  
  75. ****************************
  76. * Combat School (Original) *
  77. ****************************
  78.  
  79. 0000-005f    Video Registers (banked)
  80. 0400-0407    input ports
  81. 0408        coin counters
  82. 0410        bankswitch control
  83. 0600-06ff    palette
  84. 0800-1fff    RAM
  85. 2000-2fff    Video RAM (banked)
  86. 3000-3fff    Object RAM (banked)
  87. 4000-7fff    Banked Area + IO + Video Registers
  88. 8000-ffff    ROM
  89.  
  90. SOUND CPU:
  91. ----------
  92. 0000-8000    ROM
  93. 8000-87ff    RAM
  94. 9000        uPD7759
  95. b000        uPD7759
  96. c000        uPD7759
  97. d000        soundlatch_r
  98. e000-e001    YM2203
  99.  
  100. ***************************************************************************/
  101.  
  102. #include "driver.h"
  103. #include "cpu/z80/z80.h"
  104.  
  105. extern unsigned char* banked_area;
  106.  
  107. /* from vidhrdw/combasc.c */
  108. void combasc_convert_color_prom( unsigned char *palette, unsigned short *colortable, const unsigned char *color_prom );
  109. void combascb_convert_color_prom( unsigned char *palette, unsigned short *colortable, const unsigned char *color_prom );
  110. READ_HANDLER( combasc_video_r );
  111. WRITE_HANDLER( combasc_video_w );
  112. int combasc_vh_start( void );
  113. int combascb_vh_start( void );
  114. void combasc_vh_stop( void );
  115.  
  116. WRITE_HANDLER( combascb_bankselect_w );
  117. WRITE_HANDLER( combasc_bankselect_w );
  118. void combasc_init_machine( void );
  119. WRITE_HANDLER( combasc_pf_control_w );
  120. READ_HANDLER( combasc_scrollram_r );
  121. WRITE_HANDLER( combasc_scrollram_w );
  122.  
  123. void combascb_vh_screenrefresh( struct osd_bitmap *bitmap, int fullrefresh );
  124. void combasc_vh_screenrefresh( struct osd_bitmap *bitmap, int fullrefresh );
  125. WRITE_HANDLER( combasc_io_w );
  126. WRITE_HANDLER( combasc_vreg_w );
  127.  
  128.  
  129.  
  130.  
  131. static WRITE_HANDLER( combasc_coin_counter_w )
  132. {
  133.     /* b7-b3: unused? */
  134.     /* b1: coin counter 2 */
  135.     /* b0: coin counter 1 */
  136.  
  137.     coin_counter_w(0,data & 0x01);
  138.     coin_counter_w(1,data & 0x02);
  139. }
  140.  
  141. static READ_HANDLER( trackball_r )
  142. {
  143.     static UINT8 pos[4],sign[4];
  144.  
  145.     if (offset == 0)
  146.     {
  147.         int i,dir[4];
  148.  
  149.         for (i = 0;i < 4;i++)
  150.         {
  151.             UINT8 curr;
  152.  
  153.             curr = readinputport(4 + i);
  154.  
  155.             dir[i] = curr - pos[i];
  156.             sign[i] = dir[i] & 0x80;
  157.             pos[i] = curr;
  158.         }
  159.  
  160.         /* fix sign for orthogonal movements */
  161.         if (dir[0] || dir[1])
  162.         {
  163.             if (!dir[0]) sign[0] = sign[1] ^ 0x80;
  164.             if (!dir[1]) sign[1] = sign[0];
  165.         }
  166.         if (dir[2] || dir[3])
  167.         {
  168.             if (!dir[2]) sign[2] = sign[3] ^ 0x80;
  169.             if (!dir[3]) sign[3] = sign[2];
  170.         }
  171.     }
  172.  
  173.     return sign[offset] | (pos[offset] & 0x7f);
  174. }
  175.  
  176.  
  177. /* the protection is a simple multiply */
  178. static int prot[2];
  179.  
  180. static WRITE_HANDLER( protection_w )
  181. {
  182.     prot[offset] = data;
  183. }
  184. static READ_HANDLER( protection_r )
  185. {
  186.     return ((prot[0] * prot[1]) >> (offset * 8)) & 0xff;
  187. }
  188. static WRITE_HANDLER( protection_clock_w )
  189. {
  190.     /* 0x3f is written here every time before accessing the other registers */
  191. }
  192.  
  193.  
  194. /****************************************************************************/
  195.  
  196. static WRITE_HANDLER( combasc_sh_irqtrigger_w )
  197. {
  198.     cpu_cause_interrupt(1,0xff);
  199. }
  200.  
  201. static WRITE_HANDLER( combasc_play_w )
  202. {
  203.     if (data & 0x02)
  204.         UPD7759_start_w(0, 0);
  205. }
  206.  
  207. static WRITE_HANDLER( combasc_voice_reset_w )
  208. {
  209.     UPD7759_reset_w(0,data & 1);
  210. }
  211.  
  212. static WRITE_HANDLER( combasc_portA_w )
  213. {
  214.     /* unknown. always write 0 */
  215. }
  216.  
  217. /****************************************************************************/
  218.  
  219. static struct MemoryReadAddress combasc_readmem[] =
  220. {
  221.     { 0x0020, 0x005f, combasc_scrollram_r },
  222.     { 0x0200, 0x0201, protection_r },
  223.     { 0x0400, 0x0400, input_port_0_r },
  224.     { 0x0401, 0x0401, input_port_1_r },            /* DSW #3 */
  225.     { 0x0402, 0x0402, input_port_2_r },            /* DSW #1 */
  226.     { 0x0403, 0x0403, input_port_3_r },            /* DSW #2 */
  227.     { 0x0404, 0x0407, trackball_r },            /* 1P & 2P controls / trackball */
  228.     { 0x0600, 0x06ff, MRA_RAM },                /* palette */
  229.     { 0x0800, 0x1fff, MRA_RAM },
  230.     { 0x2000, 0x3fff, combasc_video_r },
  231.     { 0x4000, 0x7fff, MRA_BANK1 },                /* banked ROM area */
  232.     { 0x8000, 0xffff, MRA_ROM },                /* ROM */
  233.     { -1 }
  234. };
  235.  
  236. static struct MemoryWriteAddress combasc_writemem[] =
  237. {
  238.     { 0x0000, 0x0007, combasc_pf_control_w },
  239.     { 0x0020, 0x005f, combasc_scrollram_w },
  240. //    { 0x0060, 0x00ff, MWA_RAM },                    /* RAM */
  241.     { 0x0200, 0x0201, protection_w },
  242.     { 0x0206, 0x0206, protection_clock_w },
  243.     { 0x0408, 0x0408, combasc_coin_counter_w },    /* coin counters */
  244.     { 0x040c, 0x040c, combasc_vreg_w },
  245.     { 0x0410, 0x0410, combasc_bankselect_w },
  246.     { 0x0414, 0x0414, soundlatch_w },
  247.     { 0x0418, 0x0418, combasc_sh_irqtrigger_w },
  248.     { 0x041c, 0x041c, watchdog_reset_w },            /* watchdog reset? */
  249.     { 0x0600, 0x06ff, paletteram_xBBBBBGGGGGRRRRR_w, &paletteram },
  250.     { 0x0800, 0x1fff, MWA_RAM },                    /* RAM */
  251.     { 0x2000, 0x3fff, combasc_video_w },
  252.     { 0x4000, 0x7fff, MWA_ROM },                    /* banked ROM area */
  253.     { 0x8000, 0xffff, MWA_ROM },                    /* ROM */
  254.     { -1 }
  255. };
  256.  
  257. static struct MemoryReadAddress combascb_readmem[] =
  258. {
  259.     { 0x0000, 0x04ff, MRA_RAM },
  260.     { 0x0600, 0x06ff, MRA_RAM },    /* palette */
  261.     { 0x0800, 0x1fff, MRA_RAM },
  262.     { 0x2000, 0x3fff, combasc_video_r },
  263.     { 0x4000, 0x7fff, MRA_BANK1 },                /* banked ROM/RAM area */
  264.     { 0x8000, 0xffff, MRA_ROM },                /* ROM */
  265.     { -1 }
  266. };
  267.  
  268. static struct MemoryWriteAddress combascb_writemem[] =
  269. {
  270.     { 0x0000, 0x04ff, MWA_RAM },
  271.     { 0x0500, 0x0500, combascb_bankselect_w },
  272.     { 0x0600, 0x06ff, paletteram_xBBBBBGGGGGRRRRR_w, &paletteram },
  273.     { 0x0800, 0x1fff, MWA_RAM },
  274.     { 0x2000, 0x3fff, combasc_video_w },
  275.     { 0x4000, 0x7fff, MWA_BANK1, &banked_area },/* banked ROM/RAM area */
  276.     { 0x8000, 0xffff, MWA_ROM },                /* ROM */
  277.     { -1 }
  278. };
  279.  
  280. #if 0
  281. static struct MemoryReadAddress readmem_sound[] =
  282. {
  283.     { 0x0000, 0x7fff, MRA_ROM },                    /* ROM */
  284.     { 0x8000, 0x87ef, MRA_RAM },                    /* RAM */
  285.     { 0x87f0, 0x87ff, MRA_RAM },                    /* ??? */
  286.     { 0x9000, 0x9000, YM2203_status_port_0_r },        /* YM 2203 */
  287.     { 0x9008, 0x9008, YM2203_status_port_0_r },        /* ??? */
  288.     { 0xa000, 0xa000, soundlatch_r },                /* soundlatch_r? */
  289.     { 0x8800, 0xfffb, MRA_ROM },                    /* ROM? */
  290.     { 0xfffc, 0xffff, MRA_RAM },                    /* ??? */
  291.     { -1 }
  292. };
  293.  
  294. static struct MemoryWriteAddress writemem_sound[] =
  295. {
  296.     { 0x0000, 0x7fff, MWA_ROM },                /* ROM */
  297.     { 0x8000, 0x87ef, MWA_RAM },                /* RAM */
  298.     { 0x87f0, 0x87ff, MWA_RAM },                /* ??? */
  299.      { 0x9000, 0x9000, YM2203_control_port_0_w },/* YM 2203 */
  300.     { 0x9001, 0x9001, YM2203_write_port_0_w },    /* YM 2203 */
  301.     //{ 0x9800, 0x9800, combasc_unknown_w_1 },    /* OKIM5205? */
  302.     //{ 0xa800, 0xa800, combasc_unknown_w_2 },    /* OKIM5205? */
  303.     { 0x8800, 0xfffb, MWA_ROM },                /* ROM */
  304.     { 0xfffc, 0xffff, MWA_RAM },                /* ??? */
  305.     { -1 }
  306. };
  307. #endif
  308.  
  309. static struct MemoryReadAddress combasc_readmem_sound[] =
  310. {
  311.     { 0x0000, 0x7fff, MRA_ROM },                    /* ROM */
  312.     { 0x8000, 0x87ff, MRA_RAM },                    /* RAM */
  313.     { 0xb000, 0xb000, UPD7759_0_busy_r },            /* UPD7759 busy? */
  314.     { 0xd000, 0xd000, soundlatch_r },                /* soundlatch_r? */
  315.     { 0xe000, 0xe000, YM2203_status_port_0_r },        /* YM 2203 */
  316.     { -1 }
  317. };
  318.  
  319. static struct MemoryWriteAddress combasc_writemem_sound[] =
  320. {
  321.     { 0x0000, 0x7fff, MWA_ROM },                /* ROM */
  322.     { 0x8000, 0x87ff, MWA_RAM },                /* RAM */
  323.     { 0x9000, 0x9000, combasc_play_w },            /* uPD7759 play voice */
  324.     { 0xa000, 0xa000, UPD7759_0_message_w },    /* uPD7759 voice select */
  325.     { 0xc000, 0xc000, combasc_voice_reset_w },    /* uPD7759 reset? */
  326.      { 0xe000, 0xe000, YM2203_control_port_0_w },/* YM 2203 */
  327.     { 0xe001, 0xe001, YM2203_write_port_0_w },    /* YM 2203 */
  328.     { -1 }
  329. };
  330.  
  331.  
  332. #define COINAGE \
  333.     PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) \
  334.     PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) ) \
  335.     PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) ) \
  336.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) ) \
  337.     PORT_DIPSETTING(    0x04, DEF_STR( 3C_2C ) ) \
  338.     PORT_DIPSETTING(    0x01, DEF_STR( 4C_3C ) ) \
  339.     PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) ) \
  340.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_4C ) ) \
  341.     PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) ) \
  342.     PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) ) \
  343.     PORT_DIPSETTING(    0x06, DEF_STR( 2C_5C ) ) \
  344.     PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) ) \
  345.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) ) \
  346.     PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) ) \
  347.     PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) ) \
  348.     PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) ) \
  349.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) ) \
  350.     PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) \
  351.     PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) ) \
  352.     PORT_DIPSETTING(    0x50, DEF_STR( 3C_1C ) ) \
  353.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) ) \
  354.     PORT_DIPSETTING(    0x40, DEF_STR( 3C_2C ) ) \
  355.     PORT_DIPSETTING(    0x10, DEF_STR( 4C_3C ) ) \
  356.     PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) ) \
  357.     PORT_DIPSETTING(    0x30, DEF_STR( 3C_4C ) ) \
  358.     PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) ) \
  359.     PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) ) \
  360.     PORT_DIPSETTING(    0x60, DEF_STR( 2C_5C ) ) \
  361.     PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) ) \
  362.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) ) \
  363.     PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) ) \
  364.     PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) ) \
  365.     PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) ) \
  366.     PORT_DIPSETTING(    0x00, "coin 2 invalidity" )
  367.  
  368. INPUT_PORTS_START( combasc )
  369.     PORT_START
  370.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  371.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
  372.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
  373.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
  374.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
  375.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3 )
  376.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  377.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  378.  
  379.     PORT_START    /* DSW #3 */
  380.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  381.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  382.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
  383.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  384.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Flip_Screen ) )
  385.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  386.     PORT_DIPSETTING(    0x00, DEF_STR( On )  )
  387.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  388.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  389.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  390.     PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
  391.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
  392.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  393.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  394.  
  395.     PORT_START    /* DSW # 1 */
  396.     COINAGE
  397.  
  398.     PORT_START    /* DSW #2 */
  399.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
  400.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  401.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  402.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
  403.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  404.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  405.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
  406.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  407.     PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
  408.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
  409.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  410.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  411.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  412.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  413.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  414.     PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )
  415.     PORT_DIPSETTING( 0x60, "Easy" )
  416.     PORT_DIPSETTING( 0x40, "Normal" )
  417.     PORT_DIPSETTING( 0x20, "Difficult" )
  418.     PORT_DIPSETTING( 0x00, "Very Difficult" )
  419.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
  420.     PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
  421.     PORT_DIPSETTING( 0x00, DEF_STR( On ) )
  422.  
  423.     PORT_START
  424.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_PLAYER2 | IPF_8WAY )
  425.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_PLAYER2 | IPF_8WAY )
  426.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_PLAYER2 | IPF_8WAY )
  427.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_PLAYER2 | IPF_8WAY )
  428.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_PLAYER1 | IPF_8WAY )
  429.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_PLAYER1 | IPF_8WAY )
  430.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_PLAYER1 | IPF_8WAY )
  431.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_PLAYER1 | IPF_8WAY )
  432.  
  433.     PORT_START    /* only used in trackball version */
  434.     PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
  435.  
  436.     PORT_START    /* only used in trackball version */
  437.     PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
  438.  
  439.     PORT_START    /* only used in trackball version */
  440.     PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
  441. INPUT_PORTS_END
  442.  
  443. INPUT_PORTS_START( combasct )
  444.     PORT_START
  445.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  446.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
  447.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
  448.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
  449.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
  450.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3 )
  451.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  452.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  453.  
  454.     PORT_START    /* DSW #3 */
  455.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  456.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  457.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
  458.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  459.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Flip_Screen ) )
  460.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  461.     PORT_DIPSETTING(    0x00, DEF_STR( On )  )
  462.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  463.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  464.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  465.     PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
  466.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
  467.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  468.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  469.  
  470.     PORT_START    /* DSW # 1 */
  471.     COINAGE
  472.  
  473.     PORT_START    /* DSW #2 */
  474.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
  475.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  476.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  477.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
  478.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  479.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  480.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
  481.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  482.     PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
  483.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
  484.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  485.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  486.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  487.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  488.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  489.     PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )
  490.     PORT_DIPSETTING( 0x60, "Easy" )
  491.     PORT_DIPSETTING( 0x40, "Normal" )
  492.     PORT_DIPSETTING( 0x20, "Difficult" )
  493.     PORT_DIPSETTING( 0x00, "Very Difficult" )
  494.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
  495.     PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
  496.     PORT_DIPSETTING( 0x00, DEF_STR( On ) )
  497.  
  498.     /* trackball 1P */
  499.     PORT_START
  500.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_Y | IPF_PLAYER1 | IPF_REVERSE, 10, 10, 0, 0 )
  501.  
  502.     PORT_START
  503.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_X | IPF_PLAYER1, 10, 10, 0, 0 )
  504.  
  505.     /* trackball 2P (not implemented yet) */
  506.     PORT_START
  507.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_Y | IPF_PLAYER2 | IPF_REVERSE, 10, 10, 0, 0 )
  508.  
  509.     PORT_START
  510.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_X | IPF_PLAYER2, 10, 10, 0, 0 )
  511. INPUT_PORTS_END
  512.  
  513. INPUT_PORTS_START( combascb )
  514.     PORT_START
  515.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  516.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
  517.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
  518.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
  519.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
  520.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  521.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  522.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
  523.  
  524.     PORT_START
  525.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_PLAYER2 | IPF_8WAY )
  526.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_PLAYER2 | IPF_8WAY )
  527.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_PLAYER2 | IPF_8WAY )
  528.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_PLAYER2 | IPF_8WAY )
  529.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_PLAYER1 | IPF_8WAY )
  530.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_PLAYER1 | IPF_8WAY )
  531.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_PLAYER1 | IPF_8WAY )
  532.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_PLAYER1 | IPF_8WAY )
  533.  
  534.     PORT_START
  535.     COINAGE
  536.  
  537.     PORT_START
  538.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
  539.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  540.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  541.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
  542.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  543.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  544.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
  545.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  546.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  547.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  548.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  549.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  550.  
  551.     PORT_DIPNAME( 0x10, 0x00, "Allow Continue" )
  552.     PORT_DIPSETTING( 0x10, DEF_STR( No ) )
  553.     PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
  554.     PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )
  555.     PORT_DIPSETTING( 0x60, "Easy" )
  556.     PORT_DIPSETTING( 0x40, "Normal" )
  557.     PORT_DIPSETTING( 0x20, "Difficult" )
  558.     PORT_DIPSETTING( 0x00, "Very Difficult" )
  559.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
  560.     PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
  561.     PORT_DIPSETTING( 0x00, DEF_STR( On ) )
  562. INPUT_PORTS_END
  563.  
  564.  
  565.  
  566. static struct GfxLayout gfx_layout =
  567. {
  568.     8,8,
  569.     0x4000,
  570.     4,
  571.     { 0,1,2,3 },
  572.     { 0, 4, 8, 12, 16, 20, 24, 28},
  573.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
  574.     32*8
  575. };
  576.  
  577. static struct GfxLayout tile_layout =
  578. {
  579.     8,8,
  580.     0x2000, /* number of tiles */
  581.     4,        /* bitplanes */
  582.     { 0*0x10000*8, 1*0x10000*8, 2*0x10000*8, 3*0x10000*8 }, /* plane offsets */
  583.     { 0,1,2,3,4,5,6,7 },
  584.     { 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8 },
  585.     8*8
  586. };
  587.  
  588. static struct GfxLayout sprite_layout =
  589. {
  590.     16,16,
  591.     0x800,    /* number of sprites */
  592.     4,        /* bitplanes */
  593.     { 3*0x10000*8, 2*0x10000*8, 1*0x10000*8, 0*0x10000*8 }, /* plane offsets */
  594.     {
  595.         0,1,2,3,4,5,6,7,
  596.         16*8+0,16*8+1,16*8+2,16*8+3,16*8+4,16*8+5,16*8+6,16*8+7
  597.     },
  598.     {
  599.         0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8,
  600.         8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8
  601.     },
  602.     8*8*4
  603. };
  604.  
  605. static struct GfxDecodeInfo combasc_gfxdecodeinfo[] =
  606. {
  607.     { REGION_GFX1, 0x00000, &gfx_layout, 0, 8*16 },
  608.     { REGION_GFX2, 0x00000, &gfx_layout, 0, 8*16 },
  609.     { -1 }
  610. };
  611.  
  612. static struct GfxDecodeInfo combascb_gfxdecodeinfo[] =
  613. {
  614.     { REGION_GFX1, 0x00000, &tile_layout,   0, 8*16 },
  615.     { REGION_GFX1, 0x40000, &tile_layout,   0, 8*16 },
  616.     { REGION_GFX2, 0x00000, &sprite_layout, 0, 8*16 },
  617.     { REGION_GFX2, 0x40000, &sprite_layout, 0, 8*16 },
  618.     { -1 }
  619. };
  620.  
  621. static struct YM2203interface ym2203_interface =
  622. {
  623.     1,                            /* 1 chip */
  624.     3500000,                    /* this is wrong but gives the correct music tempo. */
  625.     /* the correct value is 20MHz/8=2.5MHz, which gives correct pitch but wrong tempo */
  626.     { YM2203_VOL(20,20) },
  627.     { 0 },
  628.     { 0 },
  629.     { combasc_portA_w },
  630.     { 0 }
  631. };
  632.  
  633. static struct UPD7759_interface upd7759_interface =
  634. {
  635.     1,                            /* number of chips */
  636.     UPD7759_STANDARD_CLOCK,
  637.     { 70 },                        /* volume */
  638.     { REGION_SOUND1 },            /* memory region */
  639.     UPD7759_STANDALONE_MODE,    /* chip mode */
  640.     {0}
  641. };
  642.  
  643.  
  644.  
  645. /* combat school (original) */
  646. static struct MachineDriver machine_driver_combasc =
  647. {
  648.     {
  649.         {
  650.             CPU_HD6309,
  651.             3000000,    /* 3 MHz? */
  652.             combasc_readmem,combasc_writemem,0,0,
  653.             interrupt,1
  654.         },
  655.         {
  656.             CPU_Z80 | CPU_AUDIO_CPU,
  657.             1500000,    /* 1.5 MHz? */
  658.             combasc_readmem_sound,combasc_writemem_sound,0,0,
  659.             ignore_interrupt,1     /* IRQs are caused by the main CPU */
  660.         }
  661.     },
  662.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  663.     10, /* CPU slices */
  664.     combasc_init_machine,
  665.  
  666.     /* video hardware */
  667.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  668.     combasc_gfxdecodeinfo,
  669.     128,8*16*16,
  670.     combasc_convert_color_prom,
  671.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  672.     0,
  673.     combasc_vh_start,
  674.     combasc_vh_stop,
  675.     combasc_vh_screenrefresh,
  676.  
  677.     /* sound hardware */
  678.     0,0,0,0,
  679.     {
  680.         {
  681.             SOUND_YM2203,
  682.             &ym2203_interface
  683.         },
  684.         {
  685.             SOUND_UPD7759,
  686.             &upd7759_interface
  687.         }
  688.     }
  689. };
  690.  
  691. /* combat school (bootleg on different hardware) */
  692. static struct MachineDriver machine_driver_combascb =
  693. {
  694.     {
  695.         {
  696.             CPU_HD6309,
  697.             3000000,    /* 3 MHz? */
  698.             combascb_readmem,combascb_writemem,0,0,
  699.             interrupt,1
  700.         },
  701.         {
  702.             CPU_Z80 | CPU_AUDIO_CPU,
  703.             1500000,
  704.             combasc_readmem_sound,combasc_writemem_sound,0,0, /* FAKE */
  705.             ignore_interrupt,0     /* IRQs are caused by the main CPU */
  706.         },
  707.     },
  708.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  709.     10, /* CPU slices */
  710.     combasc_init_machine,
  711.  
  712.     /* video hardware */
  713.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  714.     combascb_gfxdecodeinfo,
  715.     128,8*16*16,
  716.     combascb_convert_color_prom,
  717.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  718.     0,
  719.     combascb_vh_start,
  720.     combasc_vh_stop,
  721.     combascb_vh_screenrefresh,
  722.  
  723.     /* We are using the original sound subsystem */
  724.     0,0,0,0,
  725.     {
  726.         {
  727.             SOUND_YM2203,
  728.             &ym2203_interface
  729.         },
  730.         {
  731.             SOUND_UPD7759,
  732.             &upd7759_interface
  733.         }
  734.     }
  735. };
  736.  
  737.  
  738.  
  739. ROM_START( combasc )
  740.     ROM_REGION( 0x40000, REGION_CPU1 ) /* 6309 code */
  741.     ROM_LOAD( "611g01.rom", 0x30000, 0x08000, 0x857ffffe )
  742.     ROM_CONTINUE(           0x08000, 0x08000 )
  743.     ROM_LOAD( "611g02.rom", 0x10000, 0x20000, 0x9ba05327 )
  744.     /* extra 0x8000 for banked RAM */
  745.  
  746.     ROM_REGION( 0x10000 , REGION_CPU2 ) /* sound CPU */
  747.     ROM_LOAD( "611g03.rom", 0x00000, 0x08000, 0x2a544db5 )
  748.  
  749.     ROM_REGION( 0x80000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  750.     ROM_LOAD_GFX_EVEN( "611g07.rom",    0x00000, 0x40000, 0x73b38720 )
  751.     ROM_LOAD_GFX_ODD ( "611g08.rom",    0x00000, 0x40000, 0x46e7d28c )
  752.  
  753.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  754.     ROM_LOAD_GFX_EVEN( "611g11.rom",    0x00000, 0x40000, 0x69687538 )
  755.     ROM_LOAD_GFX_ODD ( "611g12.rom",    0x00000, 0x40000, 0x9c6bf898 )
  756.  
  757.     ROM_REGION( 0x0400, REGION_PROMS )
  758.     ROM_LOAD( "611g06.h14",  0x0000, 0x0100, 0xf916129a ) /* sprites lookup table */
  759.     ROM_LOAD( "611g05.h15",  0x0100, 0x0100, 0x207a7b07 ) /* chars lookup table */
  760.     ROM_LOAD( "611g10.h6",   0x0200, 0x0100, 0xf916129a ) /* sprites lookup table */
  761.     ROM_LOAD( "611g09.h7",   0x0300, 0x0100, 0x207a7b07 ) /* chars lookup table */
  762.  
  763.     ROM_REGION( 0x20000, REGION_SOUND1 )    /* uPD7759 data */
  764.     ROM_LOAD( "611g04.rom",  0x00000, 0x20000, 0x2987e158 )
  765. ROM_END
  766.  
  767. ROM_START( combasct )
  768.     ROM_REGION( 0x40000, REGION_CPU1 ) /* 6309 code */
  769.     ROM_LOAD( "g01.rom",     0x30000, 0x08000, 0x489c132f )
  770.     ROM_CONTINUE(            0x08000, 0x08000 )
  771.     ROM_LOAD( "611g02.rom",  0x10000, 0x20000, 0x9ba05327 )
  772.     /* extra 0x8000 for banked RAM */
  773.  
  774.     ROM_REGION( 0x10000 , REGION_CPU2 ) /* sound CPU */
  775.     ROM_LOAD( "611g03.rom", 0x00000, 0x08000, 0x2a544db5 )
  776.  
  777.     ROM_REGION( 0x80000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  778.     ROM_LOAD_GFX_EVEN( "611g07.rom",    0x00000, 0x40000, 0x73b38720 )
  779.     ROM_LOAD_GFX_ODD ( "611g08.rom",    0x00000, 0x40000, 0x46e7d28c )
  780.  
  781.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  782.     ROM_LOAD_GFX_EVEN( "611g11.rom",    0x00000, 0x40000, 0x69687538 )
  783.     ROM_LOAD_GFX_ODD ( "611g12.rom",    0x00000, 0x40000, 0x9c6bf898 )
  784.  
  785.     ROM_REGION( 0x0400, REGION_PROMS )
  786.     ROM_LOAD( "611g06.h14",  0x0000, 0x0100, 0xf916129a ) /* sprites lookup table */
  787.     ROM_LOAD( "611g05.h15",  0x0100, 0x0100, 0x207a7b07 ) /* chars lookup table */
  788.     ROM_LOAD( "611g10.h6",   0x0200, 0x0100, 0xf916129a ) /* sprites lookup table */
  789.     ROM_LOAD( "611g09.h7",   0x0300, 0x0100, 0x207a7b07 ) /* chars lookup table */
  790.  
  791.     ROM_REGION( 0x20000, REGION_SOUND1 )    /* uPD7759 data */
  792.     ROM_LOAD( "611g04.rom",  0x00000, 0x20000, 0x2987e158 )
  793. ROM_END
  794.  
  795. ROM_START( combascj )
  796.     ROM_REGION( 0x40000, REGION_CPU1 ) /* 6309 code */
  797.     ROM_LOAD( "611p01.a14",  0x30000, 0x08000, 0xd748268e )
  798.     ROM_CONTINUE(            0x08000, 0x08000 )
  799.     ROM_LOAD( "611g02.rom",  0x10000, 0x20000, 0x9ba05327 )
  800.     /* extra 0x8000 for banked RAM */
  801.  
  802.     ROM_REGION( 0x10000 , REGION_CPU2 ) /* sound CPU */
  803.     ROM_LOAD( "611g03.rom", 0x00000, 0x08000, 0x2a544db5 )
  804.  
  805.     ROM_REGION( 0x80000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  806.     ROM_LOAD_GFX_EVEN( "611g07.rom",    0x00000, 0x40000, 0x73b38720 )
  807.     ROM_LOAD_GFX_ODD ( "611g08.rom",    0x00000, 0x40000, 0x46e7d28c )
  808.  
  809.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  810.     ROM_LOAD_GFX_EVEN( "611g11.rom",    0x00000, 0x40000, 0x69687538 )
  811.     ROM_LOAD_GFX_ODD ( "611g12.rom",    0x00000, 0x40000, 0x9c6bf898 )
  812.  
  813.     ROM_REGION( 0x0400, REGION_PROMS )
  814.     ROM_LOAD( "611g06.h14",  0x0000, 0x0100, 0xf916129a ) /* sprites lookup table */
  815.     ROM_LOAD( "611g05.h15",  0x0100, 0x0100, 0x207a7b07 ) /* chars lookup table */
  816.     ROM_LOAD( "611g10.h6",   0x0200, 0x0100, 0xf916129a ) /* sprites lookup table */
  817.     ROM_LOAD( "611g09.h7",   0x0300, 0x0100, 0x207a7b07 ) /* chars lookup table */
  818.  
  819.     ROM_REGION( 0x20000, REGION_SOUND1 )    /* uPD7759 data */
  820.     ROM_LOAD( "611g04.rom",  0x00000, 0x20000, 0x2987e158 )
  821. ROM_END
  822.  
  823. ROM_START( bootcamp )
  824.     ROM_REGION( 0x40000, REGION_CPU1 ) /* 6309 code */
  825.     ROM_LOAD( "xxx-v01.12a", 0x30000, 0x08000, 0xc10dca64 )
  826.     ROM_CONTINUE(            0x08000, 0x08000 )
  827.     ROM_LOAD( "611g02.rom",  0x10000, 0x20000, 0x9ba05327 )
  828.     /* extra 0x8000 for banked RAM */
  829.  
  830.     ROM_REGION( 0x10000 , REGION_CPU2 ) /* sound CPU */
  831.     ROM_LOAD( "611g03.rom", 0x00000, 0x08000, 0x2a544db5 )
  832.  
  833.     ROM_REGION( 0x80000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  834.     ROM_LOAD_GFX_EVEN( "611g07.rom",    0x00000, 0x40000, 0x73b38720 )
  835.     ROM_LOAD_GFX_ODD ( "611g08.rom",    0x00000, 0x40000, 0x46e7d28c )
  836.  
  837.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  838.     ROM_LOAD_GFX_EVEN( "611g11.rom",    0x00000, 0x40000, 0x69687538 )
  839.     ROM_LOAD_GFX_ODD ( "611g12.rom",    0x00000, 0x40000, 0x9c6bf898 )
  840.  
  841.     ROM_REGION( 0x0400, REGION_PROMS )
  842.     ROM_LOAD( "611g06.h14",  0x0000, 0x0100, 0xf916129a ) /* sprites lookup table */
  843.     ROM_LOAD( "611g05.h15",  0x0100, 0x0100, 0x207a7b07 ) /* chars lookup table */
  844.     ROM_LOAD( "611g10.h6",   0x0200, 0x0100, 0xf916129a ) /* sprites lookup table */
  845.     ROM_LOAD( "611g09.h7",   0x0300, 0x0100, 0x207a7b07 ) /* chars lookup table */
  846.  
  847.     ROM_REGION( 0x20000, REGION_SOUND1 )    /* uPD7759 data */
  848.     ROM_LOAD( "611g04.rom",  0x00000, 0x20000, 0x2987e158 )
  849. ROM_END
  850.  
  851. ROM_START( combascb )
  852.     ROM_REGION( 0x40000, REGION_CPU1 ) /* 6809 code */
  853.     ROM_LOAD( "combat.002",     0x30000, 0x08000, 0x0996755d )
  854.     ROM_CONTINUE(            0x08000, 0x08000 )
  855.     ROM_LOAD( "combat.003",     0x10000, 0x10000, 0x229c93b2 )
  856.     ROM_LOAD( "combat.004",     0x20000, 0x10000, 0xa069cb84 )
  857.     /* extra 0x8000 for banked RAM */
  858.  
  859.     ROM_REGION( 0x10000 , REGION_CPU2 ) /* sound CPU */
  860.     ROM_LOAD( "combat.001",  0x00000, 0x10000, 0x61456b3b )
  861.     ROM_LOAD( "611g03.rom",  0x00000, 0x08000, 0x2a544db5 ) /* FAKE - from Konami set! */
  862.  
  863.     ROM_REGION( 0x80000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  864.     ROM_LOAD( "combat.006",  0x00000, 0x10000, 0x8dc29a1f ) /* tiles, bank 0 */
  865.     ROM_LOAD( "combat.008",  0x10000, 0x10000, 0x61599f46 )
  866.     ROM_LOAD( "combat.010",  0x20000, 0x10000, 0xd5cda7cd )
  867.     ROM_LOAD( "combat.012",  0x30000, 0x10000, 0xca0a9f57 )
  868.     ROM_LOAD( "combat.005",  0x40000, 0x10000, 0x0803a223 ) /* tiles, bank 1 */
  869.     ROM_LOAD( "combat.007",  0x50000, 0x10000, 0x23caad0c )
  870.     ROM_LOAD( "combat.009",  0x60000, 0x10000, 0x5ac80383 )
  871.     ROM_LOAD( "combat.011",  0x70000, 0x10000, 0xcda83114 )
  872.  
  873.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  874.     ROM_LOAD( "combat.013",  0x00000, 0x10000, 0x4bed2293 ) /* sprites, bank 0 */
  875.     ROM_LOAD( "combat.015",  0x10000, 0x10000, 0x26c41f31 )
  876.     ROM_LOAD( "combat.017",  0x20000, 0x10000, 0x6071e6da )
  877.     ROM_LOAD( "combat.019",  0x30000, 0x10000, 0x3b1cf1b8 )
  878.     ROM_LOAD( "combat.014",  0x40000, 0x10000, 0x82ea9555 ) /* sprites, bank 1 */
  879.     ROM_LOAD( "combat.016",  0x50000, 0x10000, 0x2e39bb70 )
  880.     ROM_LOAD( "combat.018",  0x60000, 0x10000, 0x575db729 )
  881.     ROM_LOAD( "combat.020",  0x70000, 0x10000, 0x8d748a1a )
  882.  
  883.     ROM_REGION( 0x0200, REGION_PROMS )
  884.     ROM_LOAD( "prom.d10",    0x0000, 0x0100, 0x265f4c97 ) /* sprites lookup table */
  885.     ROM_LOAD( "prom.c11",    0x0100, 0x0100, 0xa7a5c0b4 ) /* priority? */
  886.  
  887.     ROM_REGION( 0x20000, REGION_SOUND1 )    /* uPD7759 data */
  888.     ROM_LOAD( "611g04.rom",  0x00000, 0x20000, 0x2987e158 )    /* FAKE - from Konami set! */
  889. ROM_END
  890.  
  891.  
  892.  
  893. static void init_combasc( void )
  894. {
  895.     /* joystick instead of trackball */
  896.     install_mem_read_handler(0,0x0404,0x0404,input_port_4_r);
  897. }
  898.  
  899. static void init_combascb( void )
  900. {
  901.     unsigned char *gfx;
  902.     int i;
  903.  
  904.     gfx = memory_region(REGION_GFX1);
  905.     for (i = 0;i < memory_region_length(REGION_GFX1);i++)
  906.         gfx[i] = ~gfx[i];
  907.  
  908.     gfx = memory_region(REGION_GFX2);
  909.     for (i = 0;i < memory_region_length(REGION_GFX2);i++)
  910.         gfx[i] = ~gfx[i];
  911. }
  912.  
  913.  
  914.  
  915. GAME( 1988, combasc,  0,       combasc,  combasc,  combasc,  ROT0, "Konami", "Combat School (joystick)" )
  916. GAME( 1987, combasct, combasc, combasc,  combasct, 0,        ROT0, "Konami", "Combat School (trackball)" )
  917. GAME( 1987, combascj, combasc, combasc,  combasct, 0,        ROT0, "Konami", "Combat School (Japan trackball)" )
  918. GAME( 1987, bootcamp, combasc, combasc,  combasct, 0,        ROT0, "Konami", "Boot Camp" )
  919. GAMEX(1988, combascb, combasc, combascb, combascb, combascb, ROT0, "bootleg", "Combat School (bootleg)", GAME_IMPERFECT_COLORS )
  920.